<?php
/**
 * Created by PhpStorm.

 * Date: 2017/8/24
 * Time: 11:28
 */
namespace app\admin\controller;
use think\Db;
/**
 * Created by PhpStorm.

 *
 */
class Shoppingcar extends \think\Controller
{
    /**
     * @return mixed
     *@description
     * #param  $id 为提现单号编号
     */
    public function index()
    {
        $user_id = input('id');
        $shoppingcar=Db::field('user.user_name,sc.album_name,sc.price,sc.time,sc.id')
            ->table('zx_user user,zx_shoppingcar sc')
            ->where("sc.user_id=$user_id and user.id=sc.user_id")->paginate(1);
        $page = $shoppingcar->render();
        $this->assign('page', $page);
//        dump($shoppingcar);exit;
        $this->assign('shoppingcar', $shoppingcar);
        $this->assign('user_id', $user_id);
        return $this->fetch('index');
    }

    public function shoppingcar_del_a()
    {
        $shoppingcar_id = input('shoppingcar_id');
        $rus=db('shoppingcar')->where('id',$shoppingcar_id)->delete();
        if($rus){
            $this->success('删除成功');
        }else{
            $this->error('删除失败');
        }

    }
}